import Vue from 'vue'
import Router from 'vue-router'
import BookManage from '@/components/BookManage.vue';
import UserList from '@/components/UserList.vue';
import Login from "@/components/Login";
import Main from "@/components/Main";
import User from "@/components/User";

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: "/",
      redirect: "/login",
    },
    {
      path: "/login",
      name: "Login",
      component: Login,
    },
    // {
    //   path: "/userList",
    //   name: "UserList",
    //   component: UserList,
    // },
    {
      path: "/user",
      name: "User",
      component: User,
    },
    {
      path: "/main",
      name: "Main",
      component: Main,
      // redirect: "/main/userList",
      children: [
        {
          path: "userList",
          name: "UserList",
          component: UserList,
        },
        {
          path: 'bookManage',
          name: 'BookManage',
          component: BookManage,
        },
      ],
    },
  ],
})
